﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>项目测算</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />

    @*    @Scripts.Render("~/bundles/modernizr")*@
    @Scripts.Render("~/bundles/scripts")
    @Styles.Render("~/Content/css")
    <script type="text/javascript" src= "@Url.Content("~/Scripts/BusyIndicator.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/ModalHelper.js")"></script>
    @RenderSection("scripts", required: false)
    <style>
        th, label {
            font-weight: 400;
        }
    </style>
    <script type="text/javascript">
  
       
        $(document).ready(function ()
        {
            BusyIndicator.Inital();
            $('#prjBtn').click(function (event)
            {
                event.preventDefault();
                var url = '@Url.Action("GetPrjList", "ProjectManage")';
                var prjList = $('#prjList');
                prjList.empty();
                var appendbusygif = '<img src="' + '@Url.Content("~/Images/waiting.gif")' + '"/>';
                prjList.append(appendbusygif);
                $('#prjDialog').modal('show');
                $.post(url, null, function (data)
                {
                    var array = data;
                    prjList.empty();
                    for (var i = 0; i < array.length; i++)
                    {
                        var appendStr = '<a href="' + array[i].Id + '" class="list-group-item">' +
                                        array[i].Name +
                                        '</a>';
                        prjList.append(appendStr);
                    }
                }
                );
            }
            );

            $('#prjDialog').on('click', 'a.list-group-item', function (event)
            {
                event.preventDefault();
             
        
                var prjId = $(this).attr('href');
                var prjName = $(this).text();
                //set global value
                var url = '@Url.Action("SetCurPrj", "ProjectManage")';
                $.post(url, { 'prjId': prjId, 'prjName': prjName }, function (data)
                {
                    if (data == "1")
                    {
                        $('#prjDialog').modal('hide');
                        window.location.reload();
                    }
                    else
                    {
                        alert('erro in setting cur prj!');
                    }

                });
            }
            );

            $('#prjDialog').on('mouseover', 'a.list-group-item', function ()
            {
                $(this).addClass("active");
            });
            $('#prjDialog').on('mouseleave', 'a.list-group-item', function ()
            {
                $(this).removeClass("active");
            });
            
            $('#DoAssess').click(function (event)
            {
                if ($('#brand').text() == "尚未选择工程")
                {
                    event.preventDefault();
                    ModalHelper.showDialog("提示", "尚未选择工程,请选择后再查看!", 1);
                }
            });
            $('#deletePrj').click(function (event)
            {
                event.preventDefault();
                if ($('#brand').text() == "尚未选择工程")
                {
                    ModalHelper.showDialog("提示", "尚未选择工程,请选择后再删除!", 1);
                }
                else
                {
                    ModalHelper.showDialog("提示", "删除后不可撤销,是否删除工程?", 2, function ()
                    {
                        var url = '@Url.Action("DeletePrj","ProjectManage")';
                                      var Newurl = document.getElementById('deletePrj').href;
                                      $.post(url,
                                          function (data)
                                          {
                                              if (data = 1)
                                              {
                                                  document.location.href = Newurl;
                                              }
                                              else
                                              {
                                                  alert('Err!');
                                              }
                                          });
                                  });
                }
              }
            );
        }
        );
    </script>

</head>
<body>


    @Html.Partial("BusyDialog")
    @Html.Partial("PrjDialog")
    @Html.Partial("MsgDialog")
    <!--Menu color #FF413E3E-->
    <nav class="navbar navbar-inverse" role="navigation">

        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" id="brand" title="查看当前工程" href="@Url.Action("Index", "Home")">@PrjAssess.Models.GlobalData.PrjName</a>
            </div>
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <div id="Nav">
                    <ul class="nav navbar-nav">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong>项目测算 <b class="caret"></b></strong></a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="@Url.Action("Index", "ProjectManage")">
                                        <span>
                                            <img src="~/Images/Table-of-Contents.png" />
                                        </span>
                                        工程选择
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a id="DoAssess" href="@Url.Action("Index", "DoAssess")">
                                        <span>
                                            <img src="~/Images/Window-Information.png" />
                                        </span>
                                        项目测算信息
                                    </a>
                                </li>
                                <li>
                                    <a id="ReAssess" href="@Url.Action("DisplayCurPrj", "ReadAssess")">
                                        <span>
                                            <img src="~/Images/Command-Redo.png" />
                                        </span>
                                        重新测算
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a id="deletePrj" href="@Url.Action("Index", "ProjectManage")">
                                        <span>
                                            <img src="~/Images/Garbage-Closed.png" />
                                        </span>
                                        删除当前项目
                                    </a>
                                </li>

                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong>新项目测算 <b class="caret"></b></strong></a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="@Url.Action("Index", "ReadAssess")">
                                        <span>
                                            <img src="~/Images/Microsoft-Excel-01.png" />
                                        </span>
                                        读入Excel测算表
                                    </a>
                                </li>
                                <li><a href="@Url.Action("FillInBlank", "ReadAssess")">
                                    <span>
                                        <img src="~/Images/Note-Memo-01.png" />
                                    </span>
                                    填写新的测算表</a></li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong>项目考核<b class="caret"></b></strong></a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="@Url.Action("Mertial", "DoAssess")">
                                        <span>
                                            <img src="~/Images/Celtic knot 03.png" />
                                        </span>
                                        材料埋设
                                    </a>
                                </li>
      
                                <li>
                                    <a href="@Url.Action("Cost", "DoAssess")">
                                        <span>
                                            <img src="~/Images/Celtic knot 07.png" />
                                        </span>
                                        预算控制
                                    </a>
                                </li>
                                <li>
                                    <a href="@Url.Action("Administration", "DoAssess")">
                                        <span>
                                            <img src="~/Images/Celtic knot 08.png" />
                                        </span>
                                        管理考核
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="@Url.Action("Work", "DoAssess")">
                                        <span>
                                            <img src="~/Images/Hand-Sign-12.png" />
                                        </span>
                                        工作量考核
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="@Url.Action("Para", "DoAssess")">
                                        <span>
                                            <img src="~/Images/Keyboard.png" />
                                        </span>
                                        修改考核参数
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                    <a href="#" class="pull-right prj-list" id="prjBtn" title="选择工程"></a>


                </div>
            </div>

        </div>

    </nav>
    @RenderBody()

    

</body>

</html>
